import Vue from 'vue'
import Router from 'vue-router'
// common
import Home from '@/components/Home'
import Common from '@/components/Common'
import Login from '@/components/Login'
import Information from '@/components/Information'

// admin
import StudentManager from '@/components/admin/StudentManager'
import TeacherManager from '@/components/admin/TeacherManager'
import DepartmentManager from '@/components/admin/DepartmentManager'
import ClassManager from '@/components/admin/ClassManager'
import TaskManager from '@/components/admin/TaskManager'
import CourseManager from '@/components/admin/CourseManager'
import Details from '@/components/admin/Details'

// student
import Question from '@/components/student/Question'
import StudentResult from '@/components/student/Result'
import Task from '@/components/student/Task'
// teacher
import Listening from '@/components/teacher/Listening'
import Result from '@/components/teacher/Result'
import Self from '@/components/teacher/Self'
import Search from '@/components/teacher/Search'
import TeacherResultDetails from '@/components/teacher/ResultDetails'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/login',
    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/home',
      component: Home,
      redirect: '/home/common',
      children: 
      [
        {
          path: '/home/common',
          component: Common
        },
        {
          path: '/home/information',
          component: Information
        },
        // 管理员学生管理
        {
          path: '/home/student/manager',
          component: StudentManager
        },
        // 管理员老师管理
        {
          path: '/home/teacher/manager',
          component: TeacherManager
        },
        // 管理员学院管理
        {
          path: '/home/deparment/manager',
          component: DepartmentManager
        },
        // 管理员班级管理
        {
          path: '/home/classes/manager',
          component: ClassManager
        },  
        // 任务管理
        {
          path: '/home/task/manager',
          component: TaskManager
        },
        // 课程管理
        {
          path: '/home/course/manager',
          component: CourseManager
        },
        {
          path: '/home/details/manager',
          component: Details
        },
        // student
        {
          path: '/home/question/student',
          component: Question
        },
        {
          path: '/home/task/student',
          component: Task
        },
        {
          path: '/home/reuslt/student',
          component: StudentResult
        },
        {
          path: '/home/listening/teacher',
          component: Listening
        },
        {
          path: '/home/result/teacher',
          component: Result
        },
        {
          path: '/home/search/teacher',
          component: Search
        },
        {
          path: '/home/self/teacher',
          component: Self
        },
        {
          path: '/home/details/teacher',
          component: TeacherResultDetails
        }
      ]
    }
    
  ]
})
